import http from '@/utils/http'

// 获取预订列表
export const getReservationList = (params: { pageNum: number; pageSize: number }) => {
  return http.get('/reservation/list.do', { params })
}

// 根据状态获取预订
export const getReservationsByStatus = (status: string) => {
  return http.get('/reservation/listByStatus.do', { params: { status } })
}

// 获取今日入住
export const getTodayCheckIns = () => {
  return http.get('/reservation/todayCheckIns.do')
}

// 获取预订详情
export const getReservationDetail = (id: number) => {
  return http.get(`/reservation/detail/${id}.do`)
}

// 创建预订
export const createReservation = (data: any) => {
  return http.post('/reservation/create.do', data)
}

// 更新预订
export const updateReservation = (data: any) => {
  return http.post('/reservation/update.do', data)
}

// 确认预订
export const confirmReservation = (id: number) => {
  return http.post(`/reservation/confirm/${id}.do`)
}

// 取消预订
export const cancelReservation = (id: number) => {
  return http.post(`/reservation/cancel/${id}.do`)
}